home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Readers / Gui4Cli / Docs / Tutorials / Pipe.gc < prev    next >
Text File  |  1997-12-02  |  2KB  |  77 lines

  1. G4C
  2.  
  3. ; An example for using the xPIPE event
  4. ; ---------------------------------------------------------------
  5.  
  6.  
  7. WINBIG 146 40 412 134 pipe.gc
  8. WinType 11110001
  9. varpath ''
  10.  
  11. CTEXT 22 3 "xPIPE Event" topaz.font 9 2 0 0001
  12.  
  13. xOnLoad
  14. GuiOpen pipe.gc
  15.  
  16. xOnClose
  17. GuiQuit pipe.gc
  18.  
  19.  
  20. ; ---------------------------------------------------------------
  21. ;    The listview
  22. ; ---------------------------------------------------------------
  23.  
  24. ; a listview to show the results
  25.  
  26. XLISTVIEW 2 17 407 116 "" var "" 10 MULTI
  27. gadfont #mono 8 000        ; looks nicer lined up..
  28. gadid 1
  29.  
  30.  
  31. ; ---------------------------------------------------------------
  32. ;    Buttons for Avail and Flush
  33. ; ---------------------------------------------------------------
  34.  
  35. ; the buttons which run "avail" and "avail flush" 
  36.  
  37. ; Note : we don't have to issue the lvuse and lvadd
  38. ; commands - they are only there to make it look nicer..
  39. ; The "›32m" characters turn on/off the text highlighting.
  40.  
  41.  
  42. XBUTTON 171 0 96 16  "Avail"
  43. lvuse pipe.gc 1                 ; use the above listview
  44. lvadd "›32m----> Avail :›31m"   ; add a fancy banner (looks nicer)
  45. run 'c:avail >pipe:MyPipe'      ; run avail > our pipe
  46.  
  47.  
  48. XBUTTON 269 0 139 16   "Avail Flush"
  49. lvuse pipe.gc 1
  50. lvadd "›32m----> Avail Flush :›31m"
  51. run 'c:avail >pipe:MyPipe flush'
  52.  
  53.  
  54. ; ---------------------------------------------------------------
  55. ;    The PIPE event
  56. ; ---------------------------------------------------------------
  57.  
  58. ; This is the xPIPE event that will happen when the above
  59. ; avail commands send stuff to our pipe. We'll start it off
  60. ; as ON and keep it like that. It will quit when the gui quits.
  61.  
  62.  
  63. xPIPE pipe:MyPipe ON
  64. ; now here, the internal var $$PIPE.TXT has a line of text 
  65. ; ready for us. We use our above listview to show it..
  66. lvuse pipe.gc 1
  67. lvadd $$PIPE.TXT
  68.  
  69.  
  70. ; This event will be called again and again for every line
  71. ; that the c:avail command outputs.
  72.  
  73.  
  74.  
  75.  
  76.  
  77.